#ifndef STORAGE_H
#define STORAGE_H

#include "dal/dataprovider.h"

class Storage
{
    public:
        Storage();
        ~Storage();

        void open();
        void close();

        std::string getWorldStateVar(const std::string &name, int mapId = -1);
    private:
        Storage(const Storage &rhs);
        Storage &operator=(const Storage &rhs);
        dal::DataProvider *mDb;         /**< the data provider */
        unsigned int mItemDbVersion;    /**< Version of the item database. */

        /**
         * Synchronizes the base data in the connected SQL database with the xml
         * files like items.xml.
         * This method is called once after initialization of DALStorage.
         * Probably this function should be called if a gm requests an online
         * reload of the xml files to load new items or monsters without server
         * restart.
         */
        void syncDatabase();
};

extern Storage *storage;

#endif
